package com.qk.management.mapper;

import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper

public interface CourseMapper {

    List<Course> selectByPage(Course course);

    @Delete("delete from course where id= #{id}")
    void deleteById(Integer id);

    void insert(Course course);

    @Select("select * from course where id= #{id}")
    Course selectById(Integer id);

    void update(Course course);

    @Select("select * from course")
    List<Course> listAll();

    @Select("select * from course where subject= #{subject} limit 1")
    List<Course> selectBySubject(Integer subject);
}
